import request from './request'

export function query ({channel = 'ebj', paramCode}) {
  return request({
    url: '/roleParam/getChildList.do',
    method: 'GET',
    params: {channel, paramCode}
  })
}

export function create ({channel = 'ebj', propCode, propName, paramDesc, flagEnable, propOrder, crtId, dataType, paramCode}) {
  return request({
    url: '/roleParam/addChild.do',
    method: 'POST',
    body: {channel, propCode, propName, paramDesc, flagEnable, propOrder, crtId, dataType, paramCode}
  })
}

export function edit ({
  id, channel, propCode, propName, paramDesc, flagEnable, propOrder, updId, dataType, paramCode
}) {
  return request({
    url: '/roleParam/modifyChild.do',
    method: 'POST',
    body: {id, channel, propCode, propName, paramDesc, flagEnable, propOrder, updId, dataType, paramCode}
  })
}

export function del (id, propCode) {
  return request({
    url: '/roleParam/deleteChild.do',
    method: 'POST',
    body: {id, propCode}
  })
}
